<?php
namespace app\service;
use think\Db;

class orderService{
	public function gettoken($parkingNo){
	    $community_id= Db::name('parkinglotinfo')->where('parkingNo',$parkingNo)->value('community_id');
	    $property_id = Db::name('community')->where('id',$community_id)->value('property_id');
        return Db::name('property')->where('id',$property_id)->value('accredit');
	}
	public function getmchid($parkingNo){
	    $community_id= Db::name('parkinglotinfo')->where('parkingNo',$parkingNo)->value('community_id');
	    $property_id = Db::name('community')->where('id',$community_id)->value('property_id');
        return Db::name('property')->where('id',$property_id)->value('mch_id');
	}
	public function parkingList($where){
        return Db::name('parkinglotinfo')->where($where)->order('id asc')->select();
    }
    //查询停车场名称
    public function parkingIdName($parkingNo){
        return Db::name('parkinglotinfo')->where('parkingNo',$parkingNo)->value('parkingName');
    }
     //查询停车场信息
    public function propertyInfo($parking_id){
        $communityid = Db::name('parkinglotinfo')->where('parking_id',$parking_id)->value('community_id');
        $property = Db::name('community')->where('id',$communityid)->value('property_id');
        return Db::name('property')->where('id',$property)->find();
    }

    public function clientInfo($parkingNo,$clientNo){
        return Db::table("parking_client")->where("parkingNo",$parkingNo)->where("clientNo",$clientNo)->find();
    }

}